
<div class="main_body" id="main_body">
    <div class="breadcrub">
        当前位置：文章管理>文章列表
    </div>
    <div class="pannel">
        <form action="/article" method="get">
            <span class="sel_label">请选择文章标签：</span>
            <select name="select" id="select" class="sel_opt">
                {{range $key, $val := .tags}}
                    <option {{if eq $val.Name $.tagName}}selected="true"{{end}}>{{$val.Name}}</option>
                {{end}}
            </select>
            <input type="submit" value="查询">
        </form>

        <table class="common_table">
            <tr>
                <th width="43%">文章标题</th>
                <th width="10%">文章内容</th>
                <th width="16%">添加时间</th>
                <th width="7%">阅读量</th>
                <th width="7%">删除</th>
                <th width="7%">编辑</th>
                <th width="10%">文章类型</th>
                <th width="10%">作者</th>
            </tr>


            {{range .articles}}
                <tr>
                    <td>{{.Title}}</td>
                    <td><a href="/article/detail?id={{.Id}}">查看详情</a></td>
                    <td>{{.UpdateAt.Format "2006-01-02 15:04:05"}}</td>
                    <td>{{.Amount}}</td>
                    <td><a href="/article/delete?id={{.Id}}" class="dels">删除</a></td>
                    <td><a href="/article/update?id={{.Id}}">编辑</a></td>
                    <td>财经新闻</td>
                    <td>{{.User.Name}}</td>
                </tr>
            {{end}}
        </table>

        <ul class="pagenation">
            <li><a href="/article?page=1">首页</a></li>
            {{if lt .beforePage 2}}
                <li>上一页</li>
            {{else}}
                <li><a href="/article?page={{.beforePage}}">上一页 </a></li>
            {{end}}
            {{if ge .nextPage .pageCount}}
                <li>下一页</li>
            {{else}}
                <li> <a href="/article?page={{.nextPage}}">下一页</a></li>
            {{end}}
            <li><a href="/article?page={{.pageCount}}">末页</a></li>
            <li>共{{.count}}条记录/共{{.pageCount}}页/当前{{.page}}页</li>
        </ul>
    </div>
</div>